package com.sunny.ynhz.utils;

import com.sunny.ynhz.bean.DocBean;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * Created by hhh on 2017/11/21.
 */

public class SortFileTimeD_X {
    public static void getSortD_X(List<DocBean> mlist) {
        Collections.sort(mlist, new Comparator<DocBean>() {
            @Override
            public int compare(DocBean docBean, DocBean docBean1) {
                Long timestamp1 =docBean.getTimestamp();
                Long timestamp2 =docBean1.getTimestamp();
                //可以按User对象的其他属性排序，只要属性支持compareTo方法
                return timestamp2.compareTo(timestamp1);
            }
        });
    }
}
